<?php

// uncomment the following to define a path alias
// Yii::setPathOfAlias('local','path/to/local-folder');

// This is the main Web application configuration. Any writable
// CWebApplication properties can be configured here.
return array(
	'basePath'=>dirname(__FILE__).DIRECTORY_SEPARATOR.'..',
	'name'=>'Система самообслуживания',
	'sourceLanguage'=>'en',
	//'language'=>'uk',

	// preloading 'log' component
	'preload'=>array('log'),

	// autoloading model and component classes
	'import'=>array(
		'application.models.*',
		'application.components.*',
		'application.components.filters.*',
        'application.extensions.datafilter.*',
        'application.extensions.datafilter.filters.*',
		'application.modules.srbac.controllers.SBaseController',
	),

	// application components
	'components'=>array(
		'user'=>array(
			// enable cookie-based authentication
			'allowAutoLogin'=>false,
		),
		/*
		'db'=>array(
			'connectionString' => 'sqlite:protected/data/testdrive.db',
		),*/
		// uncomment the following to use a MySQL database
		
		'db'=>array(
			'connectionString' => 'mysql:host=localhost;dbname=netflow',
			'emulatePrepare' => true,
			'username' => 'netflow',
			'password' => 'neTfLow',
			'charset' => 'utf8',
			'enableParamLogging' => 'true',
			'tablePrefix' => 'yii_',
		),
		
		'errorHandler'=>array(
			// use 'site/error' action to display errors
            'errorAction'=>'/site/error',
        ),
		'log'=>array(
			'class'=>'CLogRouter',
			'routes'=>array(
				array(
					'class'=>'CFileLogRoute',
					'levels'=>'error, warning',
				),
				// uncomment the following to show log messages on web pages
				
				array(
					'class'=>'CWebLogRoute',
				),
				
			),
		),
		'format'=>array(
		//	'dateFormat'=>'d.m.Y',
		//	'datetimeFormat'=>'d.m.Y h:i:s',
			'booleanFormat'=>array(Yii::t('cms', 'No'), Yii::t('cms', 'Yes')),
		),
		'urlManager'=>array(
            'class'=>'application.extensions.LangUrlManager',
			'urlFormat'=>'path',
			'showScriptName'=>false,
            'languages'=>array('en','ru','uk'),
            'langParam'=>'l',
        ),
        'authManager'=>array(
        	'class'=>'CDbAuthManager',
        	'connectionID'=>'db',
            'itemTable'=>'{{authitem}}',             // The itemTable name (default:authitem)
	        'assignmentTable'=>'{{authassignment}}', // The assignmentTable name (default:authassignment)
	        'itemChildTable'=>'{{authitemchild}}', // The itemChildTable name (default:authitemchild)
        ),
	),

	// application-level parameters that can be accessed
	// using Yii::app()->params['paramName']
	'params'=>array(
		// this is used in contact page
		'adminEmail'=>'paha@irpin.com',
	),
	'modules'=>array(
	    'srbac'=>array(
			//'debug'=>true,
			'userclass'=>'Admin',
			'username'=>'username',
			'userid'=>'id',
			'superUser'=>'root',
			//'alwaysAllowed'=>array(
			//	'SiteLogin','SiteLogout','SiteError'),
        ),
    ),
);